home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_02
/
allison
/
offsetof.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-30
|
270b
|
22 lines
LISTING 4 - offsetof exposes alignment within a structure
#include <stddef.h>
#include <stdio.h>
struct Person
{
char name[15];
int age;
};
main()
{
printf("%d\n",offsetof(struct Person, age));
return 0;
}
/* Output:
16
*/